import { v4 as uuidv4 } from 'uuid';
//身份需要唯一、持久化存储
//底下封装一个函数，函数作用可以生成用户临时身份【唯一、持久化】
export const getUserId = () => {
    let USER_UUID = localStorage.getItem("USER_UUID");
    if (!USER_UUID) {
        let uu_id = uuidv4();
        localStorage.setItem('USER_UUID', uu_id);
    }
    return USER_UUID;
}